import 'package:photo_frame/utils/localization_util.dart';

class FrameFolderModel {
  String? id; // 相册ID
  String? _name; // 相册名字
  String? device_id; // 设备 ID
  String? email; // 创建相册账号

  get canEdit => !(_name == "__all__" || _name == "__fav__");

  FrameFolderModel();

  factory FrameFolderModel.fromJson(Map<String, dynamic> json) {
    FrameFolderModel model = FrameFolderModel();
    model.id = "${json['id']}";
    model._name = "${json['name']}";
    model.device_id = "${json['device_id']}";
    model.email = "${json['email']}";
    return model;
  }

  String getOriginalName() {
    return _name ?? "";
  }

  String getName() {
    return _name == "__all__"
        ? appLocal().all
        : _name == "__fav__"
            ? appLocal().favorites
            : (_name ?? "");
  }
}
